<div class="tabbable tabs-left">
              <ul class="nav nav-tabs">
              	<li><h5><?php echo $this->translate('属性信息'); ?></h5></li>
                <li class="active"><a data-toggle="tab" href="#tag_a"><?php echo $this->translate('基本信息'); ?></a></li>
              </ul>
              <form class="form-horizontal" name="attribute_form" id="attribute_form" method="post" action="">
              <input type="hidden" name="attribute_id" id="attribute_id" value="<?php if($this->attribute_info) echo $this->attribute_info->attribute_id; else echo ''; ?>" />
              <div class="tab-content">
    			<div id="sticky_navigation" style="height:30px;border-bottom:4px solid #DFDFDF;">
        			<div class="pull-left" style="font-size:16px;line-height:30px;"><strong><?php if($this->attribute_info) echo $this->translate('编辑'); else echo $this->translate('新加'); ?><?php echo $this->translate('属性'); ?></strong></div>
        			<div class="pull-right">
                	<a href="<?php echo $this->url('attributeetutor/default',array('action'=>'index')); ?>" class="btn btn-small"><i class="icon-arrow-left"></i> <?php echo $this->translate('返回属性列表'); ?></a>&nbsp;
                	<a href="<?php echo $this->serverUrl(true); ?>" class="btn btn-small btn-warning"><i class="icon-repeat icon-white"></i> <?php echo $this->translate('刷新'); ?></a>&nbsp;
                    <?php if($this->attribute_info) { ?>
                    <a href="javascript:;" onclick="return attribute_del_js(<?php echo $this->attribute_info->attribute_id; ?>);" class="btn btn-small btn-danger"><i class="icon-remove icon-white"></i> <?php echo $this->translate('删除属性'); ?></a>&nbsp;
                    <?php } ?>
                	<button type="submit" class="btn btn-small btn-primary"><i class="icon-ok icon-white"></i> <?php echo $this->translate('保存属性信息'); ?></button>&nbsp;
                	<a href="<?php echo $this->myviewalias()->dbshopHelpUrl('goods_attribute_set'); ?>" target="_blank" class="btn btn-small btn-info"><i class="icon-info-sign icon-white"></i> <?php echo $this->translate('查看帮助说明'); ?></a>
                	</div>
        		</div>
                <div id="tag_a" class="tab-pane active">
                	<div class="well admin_add_header_well"><?php echo $this->translate('基本信息'); ?></div>
                	<div class="well admin_add_well">
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('属性分组'); ?><span class="must_add_value">*</span>：</label>
           					<div class="controls">
              					<select id="attribute_group_id" name="attribute_group_id" class="span2">
                                	<option value=""><?php echo $this->translate('请选择属性组'); ?></option>
                                    <?php if ($this->attribute_group) foreach($this->attribute_group as $group_value) { ?>
                                    <option <?php echo ($this->attribute_info and $this->attribute_info->attribute_group_id == $group_value['attribute_group_id']) ? 'selected="selected"' : ''; ?> value="<?php echo $group_value['attribute_group_id']; ?>"><?php echo $group_value['attribute_group_name']; ?></option>
                                    <?php } ?>
                                </select>
            				</div>                        
                        </div>
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('属性类型'); ?><span class="must_add_value">*</span>：</label>
           					<div class="controls">
              					<select id="attribute_type" name="attribute_type" class="span2">
                                	<?php foreach ($this->input_array as $input_key => $input_value) { ?>
                                    <option value="<?php echo $input_key; ?>" <?php if ($this->attribute_info and $this->attribute_info->attribute_type ==$input_key) echo 'selected="selected"'; ?>><?php echo $input_value; ?></option>
                                    <?php } ?>
                                </select>
            				</div>                        
                        </div>                          
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('属性名称'); ?><span class="must_add_value">*</span>：</label>
           					<div class="controls">
              					<input type="text" id="attribute_name"  name="attribute_name" class="span6" value="<?php echo ($this->attribute_info ? $this->escapeHtml($this->attribute_info->attribute_name) : ''); ?>">
            				</div>                        
                        </div>
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('排序'); ?><span class="must_add_value">*</span>：</label>
           					<div class="controls">
              					<input type="text" id="attribute_sort"  name="attribute_sort" class="span1" value="<?php echo ($this->attribute_info ? $this->attribute_info->attribute_sort : '255'); ?>">
            				</div>                        
                        </div>
                                                                                                                                               
                  	</div>
                </div>
                
             </div>
              </form>
</div>
<script>
//保存验证
$(document).ready(function() {
	$("#attribute_form").validate({
		rules: {
			attribute_group_id: {
				required: true
			},			
			attribute_name: {
				required: true,
				maxlength:60
			},
			attribute_sort: {
				number: true,
				min:1,
				max:255
			}
		},
		messages: {
			attribute_group_id: {
				required: "<?php echo $this->translate('请选择属性分组！'); ?>"
			},
			attribute_name: {
				required: "<?php echo $this->translate('请输入属性名称！'); ?>",
				maxlength:"<?php echo $this->translate('属性名称最长为60个汉字！'); ?>"
			},
			attribute_sort: {
				number: "<?php echo $this->translate('属性排序必须为数字'); ?>",
				min:"<?php echo $this->translate('属性排序最小为1'); ?>",
				max:"<?php echo $this->translate('属性排序最大为255'); ?>"
			}
		}
	});
});
//属性删除js
function attribute_del_js(attribute_id) {
	if(window.confirm('<?php echo $this->translate('您确实要删除该属性吗？'); ?>')) {
	$.post("<?php echo $this->url('attributeetutor/default',array('action'=>'del')); ?>",{attribute_id:attribute_id},
	function(data){
		if(data != 'false') {
			window.location.href='<?php echo $this->url('attributeetutor/default'); ?>';
			return true;
		} else {
			alert('<?php echo $this->translate('属性删除失败！'); ?>');
		}
	});
	}
	return false;
}
</script>